package com.pingxx.boot.demo.kafka;

import lombok.extern.slf4j.Slf4j;
import org.apache.kafka.clients.consumer.ConsumerRecord;
import org.springframework.kafka.annotation.KafkaListener;
import org.springframework.stereotype.Component;

@Slf4j
@Component
public class UserConsumer {

    @KafkaListener(topics = TopicConsts.USER_TOPIC)
    public void receive(String message) {
        log.info("message {} ", message);
    }

    @KafkaListener(topics = TopicConsts.USER_TOPIC)
    public void receive2(ConsumerRecord<String, String> record) {
        log.info("K:{} V:{} ", record.key(), record.value());
    }

}
